
package com.viweb.storemanager.core;

import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.SwingConstants;


public class ColumnData implements SwingConstants {

    public static byte DEFAULT_RENDERER = 0;
    public static byte BOOLEAN_RENDERER = 1;
    public static byte NUMBER_RENDERER = 2;
    public static byte BUTTON_RENDERER = 3;
    public static byte RADIO_BUTTON_RENDERER = 4;
    private String name;
    private int width;
    private int alignment;
    private byte renderer = DEFAULT_RENDERER;
    private int propertyIndex;
    private boolean editable;
    private String tooltip;
    private Action action;
    private ImageIcon imageIcon;

    public ColumnData(String title, int width, int alignment, int propertyIndex) {
        this.setName(title);
        this.setWidth(width);
        this.setAlignment(alignment);
        this.setPropertyIndex(propertyIndex);
        this.setEditable(false);
    }

    /** Creates a new instance of ColumnData */
    public ColumnData(String title, int width, int alignment, int propertyIndex, byte renderer) {
        this.setName(title);
        this.setWidth(width);
        this.setAlignment(alignment);
        this.setRenderer(renderer);
        this.setPropertyIndex(propertyIndex);
    }

    public ColumnData(String title, int width, int alignment, byte renderer, boolean editable, String tooltip) {
        this.setName(title);
        this.setWidth(width);
        this.setAlignment(alignment);
        this.setRenderer(renderer);
        this.setEditable(editable);
        this.setTooltip(tooltip);
    }

    public ColumnData(String title, int width, int alignment, int propertyIndex, byte renderer, boolean editable) {
        this.setName(title);
        this.setWidth(width);
        this.setAlignment(alignment);
        this.setRenderer(renderer);
        this.setEditable(editable);
        this.setPropertyIndex(propertyIndex);
    }

    public ColumnData(String title, int width, int alignment, int propertyIndex, byte renderer, Action action) {
        this.setName(title);
        this.setWidth(width);
        this.setAlignment(alignment);
        this.setRenderer(renderer);
        this.setEditable(true);
        this.setAction(action);
        this.setPropertyIndex(propertyIndex);
    }

    public ColumnData(String title, int width, int alignment, int propertyIndex, byte renderer, Action action, ImageIcon imageIcon) {
        this.setName(title);
        this.setWidth(width);
        this.setAlignment(alignment);
        this.setRenderer(renderer);
        this.setEditable(true);
        this.setAction(action);
        this.setImageIcon(imageIcon);
        this.setPropertyIndex(propertyIndex);
    }

    public String getName() {
        return name;
    }

    public void setName(String title) {
        this.name = title;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getAlignment() {
        return alignment;
    }

    public void setAlignment(int alignment) {
        this.alignment = alignment;
    }

    public int getPropertyIndex() {
        return propertyIndex;
    }

    public void setPropertyIndex(int propertyIndex) {
        this.propertyIndex = propertyIndex;
    }

    public boolean isEditable() {
        return editable;
    }

    public void setEditable(boolean editable) {
        this.editable = editable;
    }

    public String getTooltip() {
        return tooltip;
    }

    public void setTooltip(String tooltip) {
        this.tooltip = tooltip;
    }

    public byte getRenderer() {
        return renderer;
    }

    public void setRenderer(byte renderer) {
        this.renderer = renderer;
    }

    public Action getAction() {
        return action;
    }

    public void setAction(Action action) {
        this.action = action;
    }

    public ImageIcon getImageIcon() {
        return imageIcon;
    }

    public void setImageIcon(ImageIcon imageIcon) {
        this.imageIcon = imageIcon;
    }
}
